import React, {Component} from 'react';
import {StyleSheet, Text, View, Image, ScrollView, Alert, ImageBackground} from 'react-native';
import {Button, WhiteSpace, WingBlank, Flex} from '@ant-design/react-native';
import {Card} from 'react-native-shadow-cards';
import moment from 'moment';
export default class Parkpublics extends Component {
    constructor(props) {
        //调用基类的所有的初始化方法
        super(props);

        // 设置当前组件的属性
        this.state = {
            //id: this.props.id,
        };
    }

    render() {
        return (
            <View style={{width: '100%', padding: 10, marginTop: 10, backgroundColor: 'white', borderRadius: 5}}>
                <Flex style={styles.flex}>
                    <Flex style={{width: '25%'}}>
                        <ImageBackground
                            style={{width: '100%', height: '100%', aspectRatio: 1 / 1}}
                            source={require('~/assets/community/background.png')}>
                            <Flex direction={'column'} style={{height: '100%', width: '100%'}} justify={'center'} align={'center'}>
                                <Text style={{color: 'white', fontSize: 16, width: '100%', textAlign: 'center'}}>
                                    {this.props.parkinginfo.AreaName}
                                </Text>
                                <Text style={{color: 'white', fontSize: 16, width: '100%', textAlign: 'center'}}>
                                    {this.props.parkinginfo.ParkingName}
                                </Text>
                            </Flex>
                        </ImageBackground>
                    </Flex>
                    <Flex style={styles.itemtextview}>
                        <Flex style={{width: '100%', paddingLeft: 10, paddingRight: 10, height: 20}} justify={'between'}>
                            <Text style={{fontSize: 16, fontWeight: 'bold', color: '#444444'}}>
                                {this.props.parkinginfo.AreaName}/{this.props.parkinginfo.ParkingName}
                            </Text>
                            {this.props.parkinginfo.ParkingPlanID > 0 && (
                                <Text style={{fontSize: 10, color: '#E57717', padding: 5, backgroundColor: '#fcf1e7'}}>
                                    {this.props.parkinginfo.PlanName}
                                </Text>
                            )}
                        </Flex>
                        <Flex justify={'start'} align={'start'} style={{width: '100%', paddingLeft: 10, marginTop: 10, paddingRight: 10, height: 15}}>
                            <Text style={{color: 'gray', fontSize: 10}}>
                                建筑面积:
                                <Text style={styles.ttext}> {this.props.parkinginfo.AreaBuilt}㎡ </Text>
                            </Text>
                            <Text style={{color: 'gray', fontSize: 12, marginLeft: 3, marginRight: 3}}>|</Text>
                            <Text style={{color: 'gray', fontSize: 10}}>
                                使用面积: <Text style={styles.ttext}>{this.props.parkinginfo.AreaInner}㎡</Text>
                            </Text>
                        </Flex>
                        <Flex justify={'between'} style={{width: '100%', paddingLeft: 10, marginTop: 6, paddingRight: 10, height: 15}}>
                            <Text style={{color: 'gray', fontSize: 12}}>
                                <Text style={{color: 'gray', fontSize: 10}}>{this.props.parkinginfo.BuildingName}</Text>
                            </Text>
                        </Flex>
                        <Flex justify={'between'} style={{width: '100%', paddingLeft: 10, marginTop: 8, paddingRight: 10, height: 15}}>
                            <Text style={{color: 'gray', fontSize: 12}}>
                                原价: <Text style={{color: 'gray', fontSize: 10}}>{this.props.parkinginfo.PriceMarket}元</Text>
                            </Text>
                            <Text style={{fontSize: 16, color: '#ec4f46'}}>￥{this.props.parkinginfo.PriceSell}</Text>
                        </Flex>
                        {/*{this.props.parkinginfo.ParkingPlanID > 0 && (*/}
                        {/*    <Flex*/}
                        {/*        justify={'start'}*/}
                        {/*        align={'start'}*/}
                        {/*        style={{width: '100%', paddingLeft: 10, marginTop: 15, paddingRight: 10, height: 15}}>*/}
                        {/*        <Text style={{color: 'gray', fontSize: 12}}>*/}
                        {/*            <Text style={styles.ttext}>{this.props.parkinginfo.BuildingName} </Text>*/}
                        {/*        </Text>*/}
                        {/*        <Text style={{color: 'gray', fontSize: 12, marginLeft: 3, marginRight: 3}}>|</Text>*/}
                        {/*        <Text style={{color: 'gray', fontSize: 12}}>*/}
                        {/*            {moment(this.props.parkinginfo.ValidBegin).format('YYYY-MM-DD HH:mm')}*/}
                        {/*        </Text>*/}
                        {/*        <Text style={{color: 'gray', fontSize: 12, marginLeft: 3, marginRight: 3}}>|</Text>*/}
                        {/*        <Text style={{color: 'gray', fontSize: 12}}>*/}
                        {/*            {moment(this.props.parkinginfo.ValidEnd).format('YYYY-MM-DD HH:mm')}*/}
                        {/*        </Text>*/}
                        {/*    </Flex>*/}
                        {/*)}*/}
                    </Flex>
                </Flex>
                {/*<Flex style={{width: '100%', height: 1, borderBottomWidth: 1, borderColor: '#F8F8FF'}} />*/}
                {/*<Flex style={{width: '100%', paddingTop: 10}} justify={'between'}>*/}
                {/*    <Flex>*/}
                {/*        <Image style={{width: 10, height: 12}} source={require('~/assets/public/quyu1.png')} />*/}
                {/*        <Text style={{paddingLeft: 5, fontSize: 12, color: '#555555'}}>区域：{this.props.parkinginfo.AreaName}</Text>*/}
                {/*    </Flex>*/}
                {/*    <Flex>*/}
                {/*        <Image style={{width: 12, height: 12}} source={require('~/assets/public/parkno.png')} />*/}
                {/*        <Text style={{paddingLeft: 5, fontSize: 12, color: '#555555'}}>车位号：{this.props.parkinginfo.ParkingName}</Text>*/}
                {/*    </Flex>*/}
                {/*</Flex>*/}
            </View>
        );
    }
}
const styles = StyleSheet.create({
    button: {
        marginBottom: 20,
    },
    button1: {
        marginBottom: 20,
        backgroundColor: '#2574CE',
    },
    image: {
        width: '100%',
        resizeMode: 'contain',
    },
    itemtextview: {
        flexDirection: 'column',
        width: '75%',
        paddingLeft: 5,
    },
    item: {
        width: '100%',
        paddingLeft: 10,
        paddingRight: 10,
        height: 25,
    },
    lowername: {
        fontSize: 13,
        color: '#444444',
        fontWeight: 'bold',
    },
    // biaoqian: {
    //     borderWidth: 1,
    //     color: '#EC4F46',
    //     borderColor: '#EC4F46',
    //     borderRadius: 12,
    //     width: 62,
    //     height: 24,
    //     textAlign: 'center',
    //     paddingTop: 2,
    // },
    money: {
        fontSize: 11,
        color: '#CE2D32',
    },
});
